#pragma once

#include "../File.h"
#include "../types.h"

#include <string>
#include <stdexcept>

class ApproxAlgorithm {
public:

    ApproxAlgorithm(double similarity_threshold) :
                    similarity_threshold_(similarity_threshold) {

        if (similarity_threshold < 0 || similarity_threshold > 1) {
            throw std::invalid_argument("Similarity threshold is invalid.");
        }
    }

    ApproxAlgorithm(const ApproxAlgorithm&) = delete;
    ApproxAlgorithm& operator = (const ApproxAlgorithm&) = delete;

    virtual ~ApproxAlgorithm() = default;

    virtual double getSim(const FilePairType& file_pair) const = 0;

private:

    double similarity_threshold_;
};
